-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update All Packages and Contract! #234
Conversation
WalkthroughThe Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Contract
participant Querier
User->>Contract: Make query
Contract->>Querier: Call querier
Querier-->>Contract: Return response
Contract-->>User: Provide results
TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (5)
- packages/injective-cosmwasm/CHANGELOG.md (1 hunks)
- packages/injective-cosmwasm/Cargo.toml (1 hunks)
- packages/injective-cosmwasm/src/exchange/subaccount.rs (2 hunks)
- packages/injective-cosmwasm/src/exchange/types.rs (2 hunks)
- packages/injective-cosmwasm/src/exchange_mock_querier.rs (9 hunks)
Additional comments not posted (20)
packages/injective-cosmwasm/CHANGELOG.md (2)
8-12
: Changelog entry for version 0.2.24 looks good.The entry accurately reflects the update to CosmWasm 2.0.
17-27
: Changelog entries for version 0.2.22 look good.The entries accurately reflect the added tests, fixed parsing issues, and removed queries.
packages/injective-cosmwasm/Cargo.toml (3)
9-9
: Package version update looks good.The version has been correctly updated from
0.2.23-rc1
to0.2.24
.
13-13
: Dependency update forcosmwasm-std
looks good.The dependency has been correctly updated from version
1.5.0
to2.1.0
.
14-14
: Dependency update forcw-storage-plus
looks good.The dependency has been correctly updated from version
1.2.0
to2.0.0
.packages/injective-cosmwasm/src/exchange/subaccount.rs (2)
55-63
: Debug print statements insubaccount_id_to_injective_address
look good.The added debug print statements provide useful information for debugging without affecting the core logic.
107-112
: Changes insubaccount_id_to_address_test
look good.The updated error message and unwrapping of the function call result improve the clarity and correctness of the test.
packages/injective-cosmwasm/src/exchange/types.rs (4)
367-368
: LGTM!The new constant
KEY_ELEMS
is defined correctly.
370-373
: LGTM!The
from_vec
method's return type change improves error handling.
374-376
: LGTM!The new
from_slice
method enhances the usability of theSubaccountId
type.
400-401
: LGTM!The new constant
KEY_ELEMS
for&SubaccountId
is defined correctly.packages/injective-cosmwasm/src/exchange_mock_querier.rs (9)
257-257
: LGTM!The type annotations ensure that the values are treated as 128-bit unsigned integers, preventing potential overflow issues.
268-268
: LGTM!The type annotations ensure that the values are treated as 128-bit unsigned integers, preventing potential overflow issues.
273-273
: LGTM!The type annotations ensure that the values are treated as 128-bit unsigned integers, preventing potential overflow issues.
282-283
: LGTM!The type annotations ensure that the values are treated as 128-bit unsigned integers, preventing potential overflow issues.
Also applies to: 299-299
1331-1345
: LGTM!The change enhances type safety by ensuring that only valid addresses are passed, reducing the risk of runtime errors associated with string manipulation.
1348-1361
: LGTM!The change enhances type safety by ensuring that only valid addresses are passed, reducing the risk of runtime errors associated with string manipulation.
1264-1266
: LGTM!The change improves readability and maintainability by utilizing constructor-like methods that can encapsulate any necessary logic for initialization.
1280-1280
: LGTM!The change improves readability and maintainability by utilizing constructor-like methods that can encapsulate any necessary logic for initialization.
Line range hint
282-299
:
LGTM!The change improves readability and maintainability by utilizing constructor-like methods that can encapsulate any necessary logic for initialization.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- packages/injective-cosmwasm/Cargo.toml (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- packages/injective-cosmwasm/Cargo.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check lints, beside that LGTM
F/injective testing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (2)
Cargo.lock
is excluded by!**/*.lock
contracts/injective-cosmwasm-mock/Cargo.lock
is excluded by!**/*.lock
Files selected for processing (21)
- .github/workflows/Basic.yml (3 hunks)
- contracts/atomic-order-example/Cargo.toml (2 hunks)
- contracts/atomic-order-example/src/contract.rs (2 hunks)
- contracts/atomic-order-example/src/tests.rs (4 hunks)
- contracts/dummy/Cargo.toml (2 hunks)
- contracts/dummy/src/mock_pyth_attestation.rs (2 hunks)
- contracts/injective-cosmwasm-mock/Cargo.toml (1 hunks)
- contracts/injective-cosmwasm-mock/src/order_management.rs (1 hunks)
- contracts/injective-cosmwasm-mock/src/testing/test_exchange.rs (4 hunks)
- contracts/injective-cosmwasm-mock/src/testing/test_exchange_derivative.rs (2 hunks)
- contracts/injective-cosmwasm-mock/src/testing/test_oracle.rs (2 hunks)
- contracts/injective-cosmwasm-mock/src/testing/test_staking.rs (1 hunks)
- contracts/injective-cosmwasm-mock/src/testing/test_token_factory.rs (2 hunks)
- contracts/injective-cosmwasm-mock/src/utils.rs (4 hunks)
- packages/injective-cosmwasm/Cargo.toml (1 hunks)
- packages/injective-math/Cargo.toml (1 hunks)
- packages/injective-math/src/fp_decimal/arithmetic.rs (1 hunks)
- packages/injective-protobuf/Cargo.toml (1 hunks)
- packages/injective-testing/Cargo.toml (1 hunks)
- packages/injective-testing/src/address_generator.rs (3 hunks)
- packages/injective-testing/src/chain_mock.rs (4 hunks)
Files skipped from review due to trivial changes (1)
- contracts/injective-cosmwasm-mock/src/testing/test_staking.rs
Files skipped from review as they are similar to previous changes (1)
- packages/injective-cosmwasm/Cargo.toml
Additional comments not posted (49)
packages/injective-testing/Cargo.toml (5)
8-8
: Version bump to0.2.1
.The version increment suggests enhancements or changes in functionality. Ensure that any changes in the package are backward-compatible or documented if breaking changes are introduced.
13-13
: Upgradecosmwasm-std
to2.1.0
.This upgrade may introduce new features or improvements. Verify compatibility with existing code and ensure that any deprecated features are addressed.
14-14
: Upgradecw-multi-test
to2.1.0
.Significant changes might affect testing capabilities. Ensure that test cases are updated to reflect any changes in the testing framework.
15-15
: Upgradeinjective-cosmwasm
to0.3.0
.This version change may incorporate new features or fixes. Verify that all dependencies and integrations with this package are functioning correctly.
16-16
: Upgradeinjective-math
to0.3.0
.Ensure that mathematical computations or features are consistent with the new version. Verify any changes in functionality.
packages/injective-math/Cargo.toml (2)
9-9
: Version bump to0.3.0
.The version increment indicates potential new features or breaking changes. Ensure that any changes are backward-compatible or documented if breaking changes are introduced.
16-16
: Upgradecosmwasm-std
to2.1.0
.This upgrade suggests compatibility with newer CosmWasm versions. Verify that all uses of
cosmwasm-std
are updated to align with the new features and deprecations.packages/injective-protobuf/Cargo.toml (2)
9-9
: Version bump to0.3.0
.The version increment indicates potential new features or breaking changes. Ensure that any changes are backward-compatible or documented if breaking changes are introduced.
19-19
: Upgradecosmwasm-std
to2.1.0
.This upgrade may introduce new features or improvements. Ensure compatibility with existing code and address any deprecated features.
contracts/dummy/Cargo.toml (4)
31-31
: Update tocw-storage-plus
version 2.0.0.The update to
cw-storage-plus
version 2.0.0 may introduce new features or changes. Verify that the codebase remains compatible with this version.
33-33
: Update toinjective-cosmwasm
version 0.3.0.The update to
injective-cosmwasm
version 0.3.0 transitions from a release candidate to a stable release. Verify compatibility with this version.
32-32
: Update tocw2
version 2.0.0.The update to
cw2
version 2.0.0 may introduce new features or changes. Ensure compatibility with this version in the codebase.
30-30
: Upgrade tocosmwasm-std
version 2.1.0.The upgrade to
cosmwasm-std
version 2.1.0 introduces new features such ascosmwasm_2_0
. Ensure that the codebase is compatible with these changes.contracts/injective-cosmwasm-mock/Cargo.toml (8)
39-39
: Update toinjective-testing
version 0.2.1.The update to
injective-testing
version 0.2.1 may introduce new features or changes. Verify compatibility with the test suite.
29-29
: Update toinjective-cosmwasm
version 0.3.0.The update to
injective-cosmwasm
version 0.3.0 transitions from a release candidate to a stable release. Verify compatibility with this version.
26-26
: Upgrade tocosmwasm-std
version 2.1.0.The upgrade to
cosmwasm-std
version 2.1.0 introduces new features such ascosmwasm_2_0
. Ensure that the codebase is compatible with these changes.
30-30
: Update toinjective-math
version 0.3.0.The update to
injective-math
version 0.3.0 may introduce new features or changes. Verify compatibility with this version in the codebase.
31-31
: Update toinjective-std
version 1.13.0.The update to
injective-std
version 1.13.0 may introduce new features or changes. Verify compatibility with this version in the codebase.
28-28
: Update tocw2
version 2.0.0.The update to
cw2
version 2.0.0 may introduce new features or changes. Ensure compatibility with this version in the codebase.
27-27
: Update tocw-storage-plus
version 2.0.0.The update to
cw-storage-plus
version 2.0.0 may introduce new features or changes. Verify that the codebase remains compatible with this version.
38-38
: Pininjective-test-tube
to version 1.13.0-1.The version of
injective-test-tube
has been pinned to1.13.0-1
, indicating a need for stability in testing. Verify compatibility with the test suite.contracts/injective-cosmwasm-mock/src/testing/test_token_factory.rs (2)
4-8
: Improve import organization.The restructuring of import statements enhances readability by logically grouping related imports. This is a good practice for maintaining clean code.
23-23
: Adddecimals
field tomsg_create_denom
.The addition of the
decimals
field with a value of6
enhances token precision, allowing for more accurate representation and handling of tokens. This is a valuable update.contracts/atomic-order-example/Cargo.toml (1)
30-38
: Verify compatibility with updated dependencies.The dependency versions have been updated significantly, including major version changes. Ensure that the codebase is compatible with these new versions and that any deprecated features are addressed.
Verification successful
Compatibility with updated dependencies verified.
The codebase does not actively use deprecated features from the updated dependencies, except in a test file where they are explicitly allowed. This suggests that the main functionality remains compatible with the new versions.
contracts/atomic-order-example/src/tests.rs
: Use of#[allow(deprecated)]
indicates controlled handling of deprecated features.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify compatibility with updated dependencies. # Test: Check for usage of deprecated features or breaking changes. # Expect: No deprecated features or breaking changes found. rg --type rust 'deprecated|breaking change'Length of output: 2952
Script:
#!/bin/bash # Description: Check for usage of deprecated features in the main codebase. # Search for usage of deprecated features within the main codebase files. rg --type rust 'deprecated' contracts/atomic-order-example/src/Length of output: 132
contracts/injective-cosmwasm-mock/src/order_management.rs (1)
2-11
: Verify usage ofcreate_stargate_msg
with new return type.The return type of
create_stargate_msg
has been changed toCosmosMsg::Any(AnyMsg)
. Ensure that all usages of this function are updated to handle the new message type appropriately..github/workflows/Basic.yml (1)
Line range hint
27-83
:
Verify compatibility with Rust toolchain1.78.0
.The Rust toolchain version has been updated to
1.78.0
. Ensure that all dependencies and the codebase are compatible with this version and that the workflow executes without issues.contracts/dummy/src/mock_pyth_attestation.rs (1)
48-51
: Improved Address Handling in TestsThe use of
Addr
andmessage_info
improves the robustness of address handling in tests by leveragingAddr::unchecked
. This change enhances type safety and clarity.packages/injective-testing/src/address_generator.rs (2)
18-20
: Enhanced Error Handling in Address GenerationThe
contract_address
method now returnsanyhow::Result<Addr>
, improving error handling in the address generation process.
22-33
: Introduction of Predictable Contract Address MethodThe
predictable_contract_address
method provides a way to generate contract addresses using a checksum and salt, enhancing flexibility and predictability in address generation.contracts/injective-cosmwasm-mock/src/testing/test_oracle.rs (2)
9-12
: Improved Import OrganizationThe reorganization of imports enhances code readability by consolidating related imports under
injective_test_tube
.
31-31
: Addition of Scaling Options in Query RequestThe
scaling_options: None
field introduces flexibility in theQueryOraclePriceRequest
, allowing for optional scaling parameters in the request.contracts/atomic-order-example/src/tests.rs (3)
36-36
: Transition tomessage_info
is correct.The use of
Addr::unchecked
withmessage_info
enhances type safety and aligns with the updated library standards.
55-60
: Improved type safety withmessage_info
.The transition to
message_info
withAddr::unchecked
enhances type safety and is consistent with the library update.
99-112
: Structured response handling withmsg_responses
.The addition of
msg_responses
in theReply
structure provides a more structured approach to handling responses, improving clarity and maintainability.contracts/atomic-order-example/src/contract.rs (2)
150-172
: Improved response parsing and error handling.The use of
Exchange::MsgCreateSpotMarketOrderResponse::decode
simplifies response parsing and enhances error handling, improving the function's readability and robustness.
Line range hint
78-116
: Verify interaction with updatedhandle_atomic_order_reply
.Ensure that the interaction between
try_swap
and the updatedhandle_atomic_order_reply
remains consistent and correct.packages/injective-testing/src/chain_mock.rs (3)
18-20
: Enhanced flexibility withStargateT
enum.The introduction of the
StargateT
enum improves the flexibility of the mock application in handling different Stargate interactions.
307-313
: Simplified instantiation withnew_custom()
.The use of
new_custom()
forBasicAppBuilder
and the streamlinedWasmKeeper
instantiation provide a more tailored and simplified setup process.
336-338
: Improved clarity incopy_binary
function.Using
to_vec().len()
for handling binary data enhances the clarity and maintainability of the function.packages/injective-math/src/fp_decimal/arithmetic.rs (1)
84-84
: Improved conversion safety in division operation.The change from
U512::try_from(y.num).unwrap()
toU512::from(y.num)
eliminates the potential for a panic, enhancing the safety of the division operation. This is a positive change as it reduces the risk of runtime errors.contracts/injective-cosmwasm-mock/src/testing/test_exchange_derivative.rs (2)
17-20
: Import reorganization improves readability.The grouping of imports enhances the clarity and structure of the code, making it easier to maintain and understand.
75-75
: Addition ofmin_notional
field in market launch.The inclusion of
min_notional: "1".to_string()
ensures that a minimum notional value is specified for the derivative market. This change likely enforces stricter requirements during testing, which can improve the robustness of market order validations.contracts/injective-cosmwasm-mock/src/testing/test_exchange.rs (4)
18-26
: Type aliasBaseCoin
improves clarity.Replacing
Coin
withBaseCoin
enhances the clarity of the code by maintaining consistency in naming conventions, which can help prevent confusion regarding the types being used.
43-45
: Explicit type specification foramount
enhances type safety.Using
100u128
instead of100
ensures clarity and type safety, aligning with Rust's strict type system.
83-83
: Use ofBaseCoin
foramount
improves consistency.The change to use
BaseCoin
for theamount
field maintains consistency with the updated type alias, enhancing readability and maintainability.
167-167
: Addition ofmin_notional
field in spot market launch.The inclusion of
min_notional: "1".to_string()
in the spot market launch function enforces a minimum trading requirement, which can enhance the robustness of market operations.contracts/injective-cosmwasm-mock/src/utils.rs (3)
329-330
: Verify themin_notional
parameter usage.The addition of the
min_notional
parameter enhances configurability. Ensure that this value is correctly used and validated in the context of the application.
368-369
: Verify themin_notional
parameter usage.The addition of the
min_notional
parameter enhances configurability. Ensure that this value is correctly used and validated in the context of the application.
760-761
: Verify theexpedited
parameter usage.The addition of the
expedited
parameter likely alters the operation's urgency. Ensure that its usage is correctly implemented and validated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good except the dependencies!
feat: killed injective-protobuf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (1)
- .github/workflows/Basic.yml (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- .github/workflows/Basic.yml
feat: created workspace cargo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range, codebase verification and nitpick comments (1)
packages/injective-cosmwasm/Cargo.toml (1)
9-9
: Version 0.3.0 not documented in CHANGELOG.mdThe version update to 0.3.0 is not documented in the
packages/injective-cosmwasm/CHANGELOG.md
. Please ensure that the changes associated with this version are properly recorded in the changelog.Analysis chain
Version update to 0.3.0.
The version bump from
0.2.23-rc1
to0.3.0
suggests significant changes or a stable release. Verify that these changes are documented in the changelog.Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the changelog reflects the version update to 0.3.0. # Test: Search for version 0.3.0 in the changelog. Expect: Detailed entries for the new version. rg --type markdown '0.3.0' CHANGELOG.mdLength of output: 92
Script:
#!/bin/bash # Search for markdown files that might contain changelog information. fd --type f --extension md # Additionally, search for any files that might contain version history or changelog information. rg -i 'changelog|version history' --type mdLength of output: 715
Script:
#!/bin/bash # Search for version 0.3.0 in the correct CHANGELOG.md file. rg '0.3.0' packages/injective-cosmwasm/CHANGELOG.mdLength of output: 51
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (7)
- Cargo.toml (1 hunks)
- contracts/atomic-order-example/Cargo.toml (2 hunks)
- contracts/dummy/Cargo.toml (2 hunks)
- contracts/injective-cosmwasm-mock/Cargo.toml (1 hunks)
- packages/injective-cosmwasm/Cargo.toml (1 hunks)
- packages/injective-cosmwasm/src/exchange/subaccount.rs (2 hunks)
- packages/injective-math/Cargo.toml (1 hunks)
Files skipped from review as they are similar to previous changes (2)
- contracts/dummy/Cargo.toml
- packages/injective-cosmwasm/src/exchange/subaccount.rs
Additional comments not posted (6)
packages/injective-math/Cargo.toml (2)
16-21
: Transition to workspace-based dependency management.Switching dependencies to use workspace declarations centralizes dependency management, reducing the risk of version conflicts and improving maintainability. Ensure that the workspace is correctly configured to handle these dependencies.
Also applies to: 24-24
9-9
: Version update to 0.3.0.The version bump from
0.2.4
to0.3.0
indicates potential new features or breaking changes. Ensure that the changelog reflects these updates accurately.packages/injective-cosmwasm/Cargo.toml (1)
13-22
: Adoption of workspace-based dependency management.The transition to workspace dependencies helps maintain consistency across projects in the workspace. This approach can simplify updates and reduce conflicts.
Also applies to: 25-27
contracts/injective-cosmwasm-mock/Cargo.toml (1)
24-35
: Shift to workspace-based dependency management.Using workspace dependencies aligns with the overall strategy to centralize and streamline dependency management, enhancing consistency and reducing potential conflicts.
Also applies to: 38-39
contracts/atomic-order-example/Cargo.toml (1)
30-41
: Shift to Workspace-Based Dependencies.The transition to using
workspace = true
for all dependencies reflects a strategic move to leverage Rust's workspace capabilities. This approach enhances modularity, simplifies dependency management, and promotes consistency across the project.Also applies to: 44-45
Cargo.toml (1)
10-47
: Introduction of New Dependencies.The addition of numerous dependencies reflects a strategic enhancement of the project's capabilities. These libraries, related to Cosmos SDK, Ethereum types, and serialization, among others, indicate a focus on improving functionality, error handling, and smart contract development. This expansion is likely to enhance development efficiency and feature richness.
feat: added relative paths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (1)
Cargo.lock
is excluded by!**/*.lock
Files selected for processing (6)
- Cargo.toml (1 hunks)
- contracts/atomic-order-example/Cargo.toml (2 hunks)
- contracts/atomic-order-example/src/contract.rs (2 hunks)
- contracts/dummy/Cargo.toml (2 hunks)
- contracts/injective-cosmwasm-mock/Cargo.toml (1 hunks)
- packages/injective-cosmwasm/Cargo.toml (1 hunks)
Files skipped from review due to trivial changes (1)
- contracts/dummy/Cargo.toml
Files skipped from review as they are similar to previous changes (2)
- contracts/atomic-order-example/src/contract.rs
- packages/injective-cosmwasm/Cargo.toml
Additional comments not posted (3)
contracts/injective-cosmwasm-mock/Cargo.toml (1)
24-35
: Adopted workspace dependencies.The transition to using
workspace = true
for dependencies is a strategic move to manage dependencies more effectively across the workspace. Ensure that the workspace configuration is correctly set up in the rootCargo.toml
file to support this change.Also applies to: 38-39
contracts/atomic-order-example/Cargo.toml (1)
30-41
: Adopted workspace dependencies.The transition to using
workspace = true
for dependencies reflects a strategic shift to manage dependencies more effectively across the workspace. Ensure that the workspace configuration is correctly set up in the rootCargo.toml
file to support this change.Also applies to: 44-45
Cargo.toml (1)
10-47
: Expanded dependency ecosystem.The addition of numerous new dependencies enhances the project's capabilities, focusing on error handling, serialization, and smart contract development. Ensure that these dependencies are necessary and that their versions and features align with the project's goals.
See changelog
Summary by CodeRabbit
injective-cosmwasm-mock
.